<ix-modal-header [requiredRoles]="requiredRoles" [title]="title" [loading]="isLoading()"></ix-modal-header>

<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-input
          formControlName="description"
          [label]="'Description' | translate"
        ></ix-input>

        <ix-input
          formControlName="command"
          [label]="'Command' | translate"
          [required]="true"
          [tooltip]="tooltips.command | translate"
        ></ix-input>

        <ix-combobox
          formControlName="user"
          [label]="'Run As User' | translate"
          [required]="true"
          [tooltip]="tooltips.user | translate"
          [provider]="userProvider"
        ></ix-combobox>

        <ix-scheduler
          formControlName="schedule"
          [label]="'Schedule' | translate"
          [required]="true"
          [tooltip]="tooltips.schedule | translate"
        ></ix-scheduler>

        <ix-checkbox
          formControlName="stdout"
          [label]="'Hide Standard Output' | translate"
          [tooltip]="tooltips.stdout | translate"
        ></ix-checkbox>

        <ix-checkbox
          formControlName="stderr"
          [label]="'Hide Standard Error' | translate"
          [tooltip]="tooltips.stderr | translate"
        ></ix-checkbox>

        <ix-checkbox
          formControlName="enabled"
          [label]="'Enabled' | translate"
        ></ix-checkbox>
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
